#ifndef GLTFMODEL_H
#define GLTFMODEL_H

#include <QOpenGLFunctions>
#include <QOpenGLVertexArrayObject>
#include <QObject>

class GLTFModel : public QObject, protected QOpenGLFunctions
{
    Q_OBJECT

public:
    explicit GLTFModel(QObject *parent = nullptr);
    ~GLTFModel();

    void initialize();
    bool loadFromFile(const std::string& filepath);
    void draw();

public:
    void cleanup();

private:
    QOpenGLVertexArrayObject *m_vao = nullptr;
    GLuint m_vbo_positions = 0; // vbo -> vbo_positions，命名更清晰
    GLuint m_vbo_normals = 0;   // <-- 新增：存储法线数据的VBO
    GLuint m_vbo_colors = 0;
    GLuint m_ebo = 0;
    GLsizei m_indexCount = 0;
};

#endif // GLTFMODEL_H
